/**
 * 
 */
package org.codesketch.birch.ssh;

/**
 * @author quirino
 *
 */
public class Response <T> {
	private int exitCode;
	private T response;
	
	/**
	 * @param exitCode
	 * @param response
	 */
	private Response(int exitCode, T response) {
		this.exitCode = exitCode;
		this.response = response;
	}
	
	/**
	 * @return the exitCode
	 */
	public int getExitCode() {
		return exitCode;
	}
	/**
	 * @return the response
	 */
	public T getResponse() {
		return response;
	}
	
	@Override
	public String toString() {
		return String.format("%d - %s", exitCode, response);
	}

	public static final <T> Response<T> with(int exitCode, T response) {
		return new Response<T>(exitCode, response);
	}
}
